package com.wj.algorithm.redmoney.one;


/**
 * @author Smile.Wu
 * @date 2016年2月17日  上午11:55:50
 */
public class RandomMoney {

	public int peoples;
	
	private double money;
	
	public RandomMoney(int peoples, double money) {
		super();
		this.peoples = peoples;
		this.money = money;
	}

	public int remainSize() {
		return peoples;
	}

	public double remainMoney() {
		return money;
	}
	
	public void clear() {
		this.peoples = 0;
		this.money = 0;
	}
	
	public double outMoney(double m) {
		double old = this.money;
		this.money -= m;
		if(money < 0) {
			money = 0;
			return old;
		}
		return m;
	}
	
	public void decrease() {
		this.peoples --;
	}
}
